package com.sjk.eurekacar.service;

import com.sjk.eurekacar.entity.TPerson;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.List;
@Slf4j
@Component
public class PersonServiceFall implements FallbackFactory<PersonService> {

    @Override
    public PersonService create(Throwable throwable) {
        return new PersonService() {
            @Override
            public List<TPerson> list() {
                log.info("发生熔断");
                return null;
            }

            @Override
            public TPerson login(TPerson tPerson) {
                log.info("发生熔断");
                return null;
            }
        };
    }
}
